package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysSuppliernperMapper;
import com.ruoyi.system.domain.SysSuppliernper;
import com.ruoyi.system.service.ISysSuppliernperService;
import com.ruoyi.common.core.text.Convert;

/**
 * 供应商期数Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-12-13
 */
@Service
public class SysSuppliernperServiceImpl implements ISysSuppliernperService 
{
    @Autowired
    private SysSuppliernperMapper sysSuppliernperMapper;

    /**
     * 查询供应商期数
     * 
     * @param supplierNperId 供应商期数ID
     * @return 供应商期数
     */
    @Override
    public SysSuppliernper selectSysSuppliernperById(Long supplierNperId)
    {
        return sysSuppliernperMapper.selectSysSuppliernperById(supplierNperId);
    }

    /**
     * 查询供应商期数列表
     * 
     * @param sysSuppliernper 供应商期数
     * @return 供应商期数
     */
    @Override
    public List<SysSuppliernper> selectSysSuppliernperList(SysSuppliernper sysSuppliernper)
    {
        return sysSuppliernperMapper.selectSysSuppliernperList(sysSuppliernper);
    }

    /**
     * 新增供应商期数
     * 
     * @param sysSuppliernper 供应商期数
     * @return 结果
     */
    @Override
    public int insertSysSuppliernper(SysSuppliernper sysSuppliernper)
    {
        sysSuppliernper.setCreateTime(DateUtils.getNowDate());
        return sysSuppliernperMapper.insertSysSuppliernper(sysSuppliernper);
    }

    /**
     * 修改供应商期数
     * 
     * @param sysSuppliernper 供应商期数
     * @return 结果
     */
    @Override
    public int updateSysSuppliernper(SysSuppliernper sysSuppliernper)
    {
        return sysSuppliernperMapper.updateSysSuppliernper(sysSuppliernper);
    }

    /**
     * 删除供应商期数对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysSuppliernperByIds(String ids)
    {
        return sysSuppliernperMapper.deleteSysSuppliernperByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除供应商期数信息
     * 
     * @param supplierNperId 供应商期数ID
     * @return 结果
     */
    @Override
    public int deleteSysSuppliernperById(Long supplierNperId)
    {
        return sysSuppliernperMapper.deleteSysSuppliernperById(supplierNperId);
    }
}
